home *** CD-ROM | disk | FTP | other *** search
- Path: red.weeg.uiowa.edu!robinson
- From: The Amorphous Mass <robinson@blue.weeg.uiowa.edu>
- Newsgroups: comp.lang.c
- Subject: Fun with <time.h>
- Date: Mon, 18 Mar 1996 15:07:36 -0600
- Organization: University of Iowa, Iowa City, IA, USA
- Distribution: world
- Message-ID: <Pine.A32.3.91.960318145539.118335A-100000@red.weeg.uiowa.edu>
- NNTP-Posting-Host: red.weeg.uiowa.edu
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Sender: robinson@red.weeg.uiowa.edu
-
-
- I'm writing a little routine that takes a date, a format to parse the
- date with, and a format to convert the date to, and so I've been sniffing
- around in <time.h>. One minor annoyance has been that if I'm given a
- date like 5/6/95 and a format that wants the day (Monday, Tuesday, etc)
- I couldn't find any functionality to do that. But someone noted in
- comp.lang.c.moderated that it was possible to pass an incomplete struct
- tm to mktime() and mktime() would "fill in the blanks" if there was
- enough information. Is this true, or am I going to have to join the
- vast and lonely horde of people looking for perpetual calendar
- algorithms? :-)
- On a side note, what does happen if you pass an incompletely filled
- struct tm (ie, some fields set to 0) to mktime()? I got some pretty
- colorful results from DEC C...
-
- /**James Robinson***********************
- "If a fatal error occurs, the program should not be allowed to continue."
- -- Oracle Pro*C User's Guide *************james-robinson@uiowa.edu**/
-